home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1998 August / PC Plus SuperCD 50a Issue 142 (CD142a) (August 1998).iso / trial / demon / TURNPIKE.1 / CLASSES.ZIP / JAVA / LANG / System.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-04-14  |  2.9 KB  |  121 lines

  1. package java.lang;
  2.  
  3. import java.io.BufferedInputStream;
  4. import java.io.BufferedOutputStream;
  5. import java.io.FileDescriptor;
  6. import java.io.FileInputStream;
  7. import java.io.FileOutputStream;
  8. import java.io.InputStream;
  9. import java.io.PrintStream;
  10. import java.util.Properties;
  11.  
  12. public final class System {
  13.    // $FF: renamed from: in java.io.InputStream
  14.    public static InputStream field_0;
  15.    public static PrintStream out;
  16.    public static PrintStream err;
  17.    private static SecurityManager security;
  18.    private static Properties props;
  19.  
  20.    private System() {
  21.    }
  22.  
  23.    public static void setSecurityManager(SecurityManager var0) {
  24.       if (security != null) {
  25.          throw new SecurityException("SecurityManager already set");
  26.       } else {
  27.          security = var0;
  28.       }
  29.    }
  30.  
  31.    public static SecurityManager getSecurityManager() {
  32.       return security;
  33.    }
  34.  
  35.    public static native long currentTimeMillis();
  36.  
  37.    public static native void arraycopy(Object var0, int var1, Object var2, int var3, int var4);
  38.  
  39.    private static native Properties initProperties(Properties var0);
  40.  
  41.    public static Properties getProperties() {
  42.       if (props == null) {
  43.          props = initProperties(new Properties());
  44.       }
  45.  
  46.       if (security != null) {
  47.          security.checkPropertiesAccess();
  48.       }
  49.  
  50.       return props;
  51.    }
  52.  
  53.    public static void setProperties(Properties var0) {
  54.       if (security != null) {
  55.          security.checkPropertiesAccess();
  56.       }
  57.  
  58.       props = var0;
  59.    }
  60.  
  61.    public static String getProperty(String var0) {
  62.       if (security != null) {
  63.          security.checkPropertyAccess(var0);
  64.       }
  65.  
  66.       if (props == null) {
  67.          props = initProperties(new Properties());
  68.       }
  69.  
  70.       return props.getProperty(var0);
  71.    }
  72.  
  73.    public static String getProperty(String var0, String var1) {
  74.       if (security != null) {
  75.          security.checkPropertyAccess(var0);
  76.       }
  77.  
  78.       if (props == null) {
  79.          props = initProperties(new Properties());
  80.       }
  81.  
  82.       return props.getProperty(var0, var1);
  83.    }
  84.  
  85.    public static String getenv(String var0) {
  86.       throw new Error("getenv no longer supported, use properties and -D instead: " + var0);
  87.    }
  88.  
  89.    public static void exit(int var0) {
  90.       Runtime.currentRuntime.exit(var0);
  91.    }
  92.  
  93.    // $FF: renamed from: gc () void
  94.    public static void method_0() {
  95.       Runtime.currentRuntime.gc();
  96.    }
  97.  
  98.    public static void runFinalization() {
  99.       Runtime.currentRuntime.runFinalization();
  100.    }
  101.  
  102.    public static void load(String var0) {
  103.       Runtime.currentRuntime.load(var0);
  104.    }
  105.  
  106.    public static void loadLibrary(String var0) {
  107.       Runtime.currentRuntime.loadLibrary(var0);
  108.    }
  109.  
  110.    static {
  111.       try {
  112.          Runtime var0 = Runtime.getRuntime();
  113.          field_0 = var0.getLocalizedInputStream(new BufferedInputStream(new FileInputStream(FileDescriptor.in), 128));
  114.          out = new PrintStream(var0.getLocalizedOutputStream(new BufferedOutputStream(new FileOutputStream(FileDescriptor.out), 128)), true);
  115.          err = new PrintStream(var0.getLocalizedOutputStream(new BufferedOutputStream(new FileOutputStream(FileDescriptor.err), 128)), true);
  116.       } catch (Exception var1) {
  117.          throw new Error("can't initialize stdio");
  118.       }
  119.    }
  120. }
  121.